<?php

/**
 * PaymentVersion form base class.
 *
 * @method PaymentVersion getObject() Returns the current form's model object
 *
 * @package    BuLaBuSys2013
 * @subpackage form
 * @author     Maximilian Lenkeit
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasePaymentVersionForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'              => new sfWidgetFormInputHidden(),
      'booking_id'      => new sfWidgetFormInputText(),
      'date_of_receipt' => new sfWidgetFormDate(),
      'amount'          => new sfWidgetFormInputText(),
      'created_at'      => new sfWidgetFormInputText(),
      'updated_at'      => new sfWidgetFormInputText(),
      'deleted_at'      => new sfWidgetFormInputText(),
      'created_by'      => new sfWidgetFormInputText(),
      'updated_by'      => new sfWidgetFormInputText(),
      'deleted_by'      => new sfWidgetFormInputText(),
      'version'         => new sfWidgetFormInputHidden(),
    ));

    $this->setValidators(array(
      'id'              => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'booking_id'      => new sfValidatorInteger(array('required' => false)),
      'date_of_receipt' => new sfValidatorDate(array('required' => false)),
      'amount'          => new sfValidatorNumber(array('required' => false)),
      'created_at'      => new sfValidatorPass(array('required' => false)),
      'updated_at'      => new sfValidatorPass(array('required' => false)),
      'deleted_at'      => new sfValidatorPass(array('required' => false)),
      'created_by'      => new sfValidatorInteger(array('required' => false)),
      'updated_by'      => new sfValidatorInteger(array('required' => false)),
      'deleted_by'      => new sfValidatorInteger(array('required' => false)),
      'version'         => new sfValidatorChoice(array('choices' => array($this->getObject()->get('version')), 'empty_value' => $this->getObject()->get('version'), 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('payment_version[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'PaymentVersion';
  }

}
